import * as types from './action-types';

/**
 * 这是一个用来跳转路径的actionCreator
 * @param {*} path 跳转路径
 */
function push(path) {
    return {
        type: types.CALL_HISTORY_METHOD,
        payload: {
            method: 'push',
            args: [path]
        }
    }
}

/**
 * 路径变化的actionCreator
 * @param {*} location 
 * @param {*} action 
 */
function locationChange(location, action) {
    return {
        type: types.LOCATION_CHANGE,
        payload: {
            location,
            action
        }
    }
}

export {
    push,
    locationChange
};
